//
//  HttpClient.h
//  OCUI
//
//  Created by login on 15-6-25.
//
//
#import <Foundation/Foundation.h>
#import "ASIHTTPRequest.h"
typedef enum {
    GET,
    POST
}RequestType;

@protocol HttpClientDelegate <NSObject>

- (void)sendRequestDataArray:(NSDictionary *)dict;

@end

@interface HttpClient : NSObject<ASIHTTPRequestDelegate>
@property(nonatomic,retain)id<HttpClientDelegate>delegate;

/*
 @method: 带进度条获取数据
 @param:view 主视图
 @param:urlString 请求地址
 @param:urlDic  请求内容
 @param:type  请求方式 GET/POST
 @result:block  返回数组
 */
+ (void)getRequestWithProgress:(UIView *)view and:(NSString *)urlString and:(NSDictionary *)urlDic requestType:(RequestType)type andResult:(void(^)(NSArray *mainArray))block;
/*
 @method: 同步获取数据
 @param:urlString 请求地址
 @param:urlDic  请求内容
 @param:type  请求方式 GET/POST
 @result:block  返回数组
 */
+ (void)getRequestSync:(NSString *)urlString and:(NSDictionary *)urlDic requestType:(RequestType)type andResult:(void(^)(NSArray *receiveArray))block;

/*
 @method: 带进度条获取数据
 @param:view 主视图
 @param:urlString 请求地址
 @param:urlDic  请求内容
 @param:type  请求方式 GET/POST
 */

- (void)getRequestAsyWithProgress:(UIView *)view and:(NSString *)urlString and:(NSDictionary *)urlDic requestType:(RequestType)type;


@end
